package com.kx.core.jdbc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.kx.core.jdbc.domain.User;
import com.kx.core.jdbc.service.UserService;

/**
 * 用户控制层
 * @author     Kangx.li 1703054
 * @version    V1 2018年11月23日
 * @since      Java
 */
@RestController
public class UserRestController {

    @Autowired
    private UserService userServiceImpl;
    
//    @RequestMapping(value = "/jdbc/user", method = RequestMethod.GET)
//    public User findByName(@RequestParam(value = "userName", required = true) String userName) {
//        return userServiceImpl.findByName(userName);
//    }
    @RequestMapping(value = "/jdbc/user", method = RequestMethod.GET)
    public User findByName() {
	String userName = "泥瓦匠";
	return userServiceImpl.findByName(userName);
    }
}

